package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;

/**
 * 类功能描述(类上)
 *
 * @author AnBetter
 * @since 2021-04-15
 */
public class ButtonRenderer implements Sequenceable, Serializable {
    @SerializedName("trackingParams")
    private String trackingParams;

    @SerializedName("size")
    private String size;

    @SerializedName("style")
    private String style;

    @SerializedName("text")
    private Text text;

    @SerializedName("serviceEndpoint")
    private ServiceEndpoint serviceEndpoint;

    @SerializedName("navigationEndpoint")
    private NavigationEndpoint navigationEndpoint;

    public static final Sequenceable.Producer<ButtonRenderer> CREATOR = new Producer<ButtonRenderer>() {
        @Override
        public ButtonRenderer createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            ButtonRenderer buttonRenderer = new ButtonRenderer();
            buttonRenderer.unmarshalling(parcel);
            return buttonRenderer;
        }
    };

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeString(this.trackingParams);
        parcel.writeString(this.size);
        parcel.writeString(this.style);
        parcel.writeSequenceable(this.text);
        parcel.writeSequenceable(this.serviceEndpoint);
        parcel.writeSequenceable(this.navigationEndpoint);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        this.trackingParams=parcel.readString();
        this.size=parcel.readString();
        this.style=parcel.readString();
        parcel.readSequenceable(this.text);
        parcel.readSequenceable(this.serviceEndpoint);
        parcel.readSequenceable(this.navigationEndpoint);
        return true;
    }

    public String toString() {
        return "ButtonRenderer{" +
                "trackingParams = '" + trackingParams + '\'' +
                ",size = '" + size + '\'' +
                ",style = '" + style + '\'' +
                ",text = '" + text + '\'' +
                ",serviceEndpoint = '" + serviceEndpoint + '\'' +
                ",navigationEndpoint = '" + navigationEndpoint + '\'' +
                "}";
    }

    public String getTrackingParams() {
        return trackingParams;
    }

    public void setTrackingParams(String trackingParams) {
        this.trackingParams = trackingParams;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public Text getText() {
        return text;
    }

    public void setText(Text text) {
        this.text = text;
    }

    public ServiceEndpoint getServiceEndpoint() {
        return serviceEndpoint;
    }

    public void setServiceEndpoint(ServiceEndpoint serviceEndpoint) {
        this.serviceEndpoint = serviceEndpoint;
    }

    public NavigationEndpoint getNavigationEndpoint() {
        return navigationEndpoint;
    }

    public void setNavigationEndpoint(NavigationEndpoint navigationEndpoint) {
        this.navigationEndpoint = navigationEndpoint;
    }
}
